<!--/*******操作*******/-->
<div class="layui-form-item">
	<blockquote class="layui-elem-quote layui-quote-nm">
		<div class="layui-inline">
			<div class="layui-input-inline">
				<button id="infoAddBtn" th:href="@{/admin/m/base/info/add_{nodeId}.gsp(nodeId=${nodeId})}" th:classappend="${nodeId==null}?layui-btn-disabled" class="layui-btn">
					<i class="layui-icon">&#xe61f;</i> 新增
				</button>
			</div>
		</div>
	</blockquote>
</div>
<table id="infoDataTable" class="layui-table">
	<thead>
		<tr>
			<th width="60" class="text-center">#</th>
			<th>状态</th>
			<th>所属栏目</th>
			<th>主标题</th>
			<th class="text-center">发布日期</th>
			<th class="text-center">创建者</th>
			<th class="text-center">排序</th>
			<th class="text-center">浏览总数</th>
			<th width="120" class="text-center">操作</th>
		</tr>
	</thead>
	<tbody>
		<tr th:if="${result == null or result.size() == 0}">
			<td colspan="9" style="text-align: center;">暂时没有数据</td>
		</tr>
		<tr th:each="item,items:${result}">
			<td th:text="${items.index+1}" style="text-align: center;">序号</td>
			<td th:text="${item.state==1?'已发布':'未发布'}">状态</td>
			<td th:text="${item.noddName}">所属栏目</td>
			<td th:text="${item.title}">主标题</td>
			<td th:text="${item.publishTime!=null?#dates.format(item.publishTime,'yyyy-MM-dd'):''}">发布日期</td>
			<td th:text="${item.createDataUsername}">创建者</td>
			<td th:text="${item.sortOrder}">排序</td>
			<td th:text="${item.viewsCount}">浏览总数</td>
			<td style="text-align: center;"><button class="layui-btn layui-btn-small" th:href="@{/admin/m/base/info/edit_{id}.gsp(id=${item.id})}" onclick="loadEditInfo(this)">
					<i class="layui-icon">&#xe642;</i>
				</button>
				<button class="layui-btn layui-btn-small layui-btn-normal" th:onclick="|deleted('${item.id}')|">
					<i class="layui-icon">&#xe640;</i>
				</button></td>
		</tr>
	</tbody>
</table>
<script th:inline="javascript">
    /*<![CDATA[*/
    $('#infoAddBtn').click(function() {
        $("#infoContent").load($(this).attr('href'));
    });
    function loadEditInfo(obj) {
        $("#infoContent").load($(obj).attr('href'));
    }
    
    var deleteUrl = /*[[@{/admin/m/base/info/delete_{id}.gsp}]]*/;
    function deleted(id) {
        tg_deleteItem(deleteUrl.replace('{id}',id), function(){
            location.reload();
        });
    }
    /*]]>*/
</script>
